
<UserControl
	x:Class="Goldlight.SampleApplication.Views.HomePageView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:behavior="clr-namespace:Goldlight.Mvvm.Base.Behaviors;assembly=Goldlight.Mvvm.Base"
	xmlns:vm="clr-namespace:Goldlight.SampleApplication.ViewModels"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	Width="600">
	<UserControl.Resources>
		<vm:HomePageViewModel x:Key="VM"/>
		<Style TargetType="{x:Type TextBlock}">
			<Setter Property="Margin" Value="2"/>
		</Style>
		<Style x:Key="H2" TargetType="{x:Type TextBlock}">
			<Setter Property="Foreground" Value="#FF100EC2"/>
			<Setter Property="FontWeight" Value="Bold"/>
			<Setter Property="FontSize" Value="18"/>
		</Style>
		<Style BasedOn="{StaticResource {x:Type ListBox}}" TargetType="{x:Type ListView}">
			<Setter Property="BorderBrush" Value="Black"/>
			<Setter Property="BorderThickness" Value="0.5"/>
			<Setter Property="Background" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate>
						<Border Margin="{TemplateBinding Margin}" Background="{TemplateBinding Background}">
							<ScrollViewer Margin="{TemplateBinding Padding}">
								<WrapPanel
									MinWidth="260"
									Width="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
									IsItemsHost="True"
									ItemWidth="260">
								</WrapPanel>
							</ScrollViewer>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="{x:Type ListViewItem}">
			<Setter Property="Padding" Value="3"/>
			<Setter Property="Margin" Value="5"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="ContentTemplate">
				<Setter.Value>
					<DataTemplate>
						<Border>
							<Grid Width="240" Height="180" behavior:ClickBehavior.Click="{Binding PageCommand}">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="40"/>
									<ColumnDefinition/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="30"/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								<Image
									Width="32"
									Height="32"
									Grid.Column="0"
									Grid.Row="0"
									Grid.RowSpan="2"
									VerticalAlignment="Top"
									Source="{Binding Picture, Mode=OneWay}"/>
								<TextBlock
									Grid.Column="1"
									Grid.Row="0"
									Style="{StaticResource H2}"
									Text="{Binding Title, Mode=OneWay}"/>
								<TextBlock
									Grid.Column="1"
									Grid.Row="1"
									VerticalAlignment="Top"
									Text="{Binding Snippet, Mode=OneWay}"
									TextWrapping="Wrap"/>
							</Grid>
						</Border>
					</DataTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
	<ListView
		HorizontalAlignment="Left"
		VerticalAlignment="Top"
		DataContext="{StaticResource VM}"
		ItemsSource="{Binding Pages, Mode=OneWay}"/>
</UserControl>